package org.example.controller;

import lombok.AllArgsConstructor;
import org.example.entity.Goods;
import org.example.service.GoodsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@AllArgsConstructor
@RequestMapping("/Goods")
public class GoodsController {
    private final GoodsService goodsService;

    @GetMapping("/findAll")
    public List<Goods> findAll() {
        return goodsService.findAll();
    }

    @GetMapping("/goodsList")
    public List<Goods> getGoodsList() {
        return goodsService.getAllGoods();
    }
}
